With the 'clicked' attribute you can set a script file that is called when the block is placed. You can use world and origin for your script.
added="loader.loadScript('xyz.script');";